var e = require('1E1DDD9770B67DCF787BB59075001B27.js');
module.exports = function () {
  return new Promise(function (n, o) {
    wx.setStorageSync('contLoginLock', '1'),
      wx.chooseImage({
        success: function (i) {
          var t = i.tempFilePaths;
          wx.showLoading({ title: '上传中' }),
            wx.uploadFile({
              url: ''.concat(e.baseUrl, '/v1/index/upload-files'),
              filePath: t[0],
              name: 'file',
              success: function (e) {
                wx.hideLoading();
                var i = JSON.parse(e.data).data;
                i && 0 !== i.length
                  ? n(i[0])
                  : (wx.showToast({
                      title: '上传出错, 文件太大？',
                      icon: 'none',
                    }),
                    o(e));
              },
            });
        },
        fail: function (e) {
          wx.hideLoading(), o(e);
        },
      });
  });
};
